package com.viking.util.ftp;

import lombok.extern.slf4j.Slf4j;

import java.io.*;
import java.util.Properties;

/**
 * @author Silence
 * @date 2023年 02月23日 20:31:27
 */
@Slf4j
public final class FtpSettingUtil {
    private static Object value;

    private static volatile FtpSettingUtil ftpSettingUtil =new FtpSettingUtil();
    private FtpSettingUtil(){}
    public static Object getPropertyValue(String name) {
        try {
            InputStream inputStream = new FileInputStream(new File("src/main/resources/config/ftpconfigration.properties"));
            Properties prop = new Properties();
            prop.load(inputStream);
            value = prop.getProperty(name);
        }catch (FileNotFoundException e){
            log.info("FtpPropertyNotFound");
        } catch (IOException e) {
            log.info("prop.load IOException");
        }
        return value;
    }
}
